const fs = require('fs'); // file system

const result = fs.readFile('./06-fs.js', {}, (err, data) => {
  if (err) {
    console.log(err);
    /*
    { Error: ENOENT: no such file or directory, open 'H:\STUDY\09-nodejs-base\01-CommonJs\06-fs'
      errno: -4058,
      code: 'ENOENT',
      syscall: 'open',
      path: 'H:\\STUDY\\09-nodejs-base\\01-CommonJs\\...' }
     */
  } else {
    console.log(data.toString());
  }
});

console.log(result); 
// undefined 这是因为readFile()没有返回值
